/***************************************************************************
 *   Copyright (C) 2009 by Marian Skvarek   *
 *   skvarek.marian@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A TrackICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef EASYSCORE_COREICSYMBOL_H
#define EASYSCORE_COREICSYMBOL_H

#include "CGlobals.h"
#include "CBar.h"

namespace easyscore
{
	namespace core
	{
		
                class CTrack;
                class CPart;
                class CScore;

		class CSymbolView;

                /**
                        Abstract musical symbol - note, pause ...
			@author Marian Skvarek <skvarek.marian@gmail.com>
		*/
		class CSymbol
		{
//Members
			protected:
				NOTE_VALUE mValue;
				CBar *mParentBar;
				
//Accessors
			public:
				void setValue(NOTE_VALUE value) { mValue = value; }
				NOTE_VALUE getValue() const { return mValue; }
				void setParentBar ( CBar* value ) { mParentBar = value; }
				CBar* getParentBar() const { return mParentBar; }
                                CTrack *getParentTrack() { return mParentBar->getParentTrack(); }
                                CPart *getParentPart() { return mParentBar->getParentPart(); }
                                CScore *getParentScore() { return mParentBar->getParentScore(); }

				
//Constructors, Initialization and Destructors
			public:
				CSymbol(NOTE_VALUE value = NOTE_VALUE_UNKNOWN);
				virtual void initialize();
				
				virtual void clear();
				virtual ~CSymbol();
				
//Public Methods
			public:
                                virtual bool isRest() { return false; }
                                virtual bool isNoteGroup() { return false; }
				
				 virtual CSymbolView *getSymbolView() = 0;
				 virtual bool hasView() { return getSymbolView() != 0; }
				 virtual void createView() = 0;
				 virtual void destroyView() = 0;

		};//class CSymbol
	}//namespace core
}//namespace easyscore

#endif
